package com.fxcharts.widget.linechart;
import javafx.scene.paint.Color;
import com.fxcharts.widget.linechart.ExLineSeries;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.animation.Interpolator; 

/**
* @author Aliaksandr_Spichakou
* Line series for Line chart
*/

public class ExLineSeries
{
    /**
    * Serial name
    */
    public-init var name:String="Series";
    /**
    * Color for line (Default is RED)
    */
    public-init var color:Color=Color.RED;
    /**
    * Array of line data
    */    
    public-init var data:ExLineData[]=[];
    /**
    * Line width
    */
    public-init var lineWidth:Number=3;
    
    // Default animation, can be ovirrided
    /**
    * Max line width (for pulsation)
    */
    public-init var lineWidthMax:Number=5;
    /**
    * Min line width (for pulsation)
    */
    public-init var lineWidthMin:Number=3;
    
    /**
    * Default timelane for default animation: simple pulsation
    */    
    public var tUp = Timeline {
                                     repeatCount: Timeline.INDEFINITE
                                     keyFrames: [
                                         KeyFrame {
                                             time: 1s
                                             canSkip: true
                                             values: [                                             	 
                                                 lineWidth => lineWidthMax tween Interpolator.LINEAR                                                 
                                             ]
                                         }
                                         KeyFrame {
                                                      time: 2s
                                                      canSkip: true
                                                      values: [
                                                          lineWidth => lineWidthMin tween Interpolator.LINEAR
                                                      ]
                                                  }
                                     ]
                                 }; 
}